package com.lcxw.hxzb.friendcircle.project.system.service.impl;

import java.util.List;

import com.lcxw.hxzb.friendcircle.common.utils.DateUtils;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdBargaining;
import com.lcxw.hxzb.friendcircle.project.system.mapper.YwpdBargainingMapper;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdBargainingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 会员砍价Service业务层处理
 * 
 * @author meeting
 * @date 2020-10-14
 */
@Service
public class YwpdBargainingServiceImpl implements IYwpdBargainingService
{
    @Autowired
    private YwpdBargainingMapper ywpdBargainingMapper;

    /**
     * 查询会员砍价
     * 
     * @param bargainingId 会员砍价ID
     * @return 会员砍价
     */
    @Override
    public YwpdBargaining selectYwpdBargainingById(Long bargainingId)
    {
        return ywpdBargainingMapper.selectYwpdBargainingById(bargainingId);
    }

    /**
     * 查询会员砍价列表
     * 
     * @param ywpdBargaining 会员砍价
     * @return 会员砍价
     */
    @Override
    public List<YwpdBargaining> selectYwpdBargainingList(YwpdBargaining ywpdBargaining)
    {
        return ywpdBargainingMapper.selectYwpdBargainingList(ywpdBargaining);
    }

    /**
     * 新增会员砍价
     * 
     * @param ywpdBargaining 会员砍价
     * @return 结果
     */
    @Override
    public int insertYwpdBargaining(YwpdBargaining ywpdBargaining)
    {
        ywpdBargaining.setCreateTime(DateUtils.getNowDate());
        return ywpdBargainingMapper.insertYwpdBargaining(ywpdBargaining);
    }

    /**
     * 修改会员砍价
     * 
     * @param ywpdBargaining 会员砍价
     * @return 结果
     */
    @Override
    public int updateYwpdBargaining(YwpdBargaining ywpdBargaining)
    {
        return ywpdBargainingMapper.updateYwpdBargaining(ywpdBargaining);
    }

    /**
     * 批量删除会员砍价
     * 
     * @param bargainingIds 需要删除的会员砍价ID
     * @return 结果
     */
    @Override
    public int deleteYwpdBargainingByIds(Long[] bargainingIds)
    {
        return ywpdBargainingMapper.deleteYwpdBargainingByIds(bargainingIds);
    }

    /**
     * 删除会员砍价信息
     * 
     * @param bargainingId 会员砍价ID
     * @return 结果
     */
    @Override
    public int deleteYwpdBargainingById(Long bargainingId)
    {
        return ywpdBargainingMapper.deleteYwpdBargainingById(bargainingId);
    }
}
